package com.example.designpatterns.creational.singleton;

/**
 * @author zuitu@foxmail.com
 * @date 2024/1/18
 * 静态内部类
 */
public class StaticInnerClass {
    private static class SingletonHolder {
        private static final User INSTANCE = new User();
    }

    private StaticInnerClass() {
    }

    public static User getInstance() {
        return SingletonHolder.INSTANCE;
    }
}
